﻿using LogisticsMSCommon;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogisticsMSBLL;

namespace LogisticsAdminMS
{
    public partial class Reg : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            //1、获取前台用户输入信息
            string account = txtAccount.Text;
            string pwd = txtPwd.Text;
            string tel = txtTel.Text;
            string pwdR = txtPwdR.Text;
            //2、判空处理
            if (string.IsNullOrWhiteSpace(account))
            {
                JsHelper.Alert(this, "您的账号不能为空");
                return;
            }
            if (string.IsNullOrWhiteSpace(tel))
            {
                JsHelper.Alert(this, "您的手机号不能为空");
                return;
            }
            if (string.IsNullOrWhiteSpace(pwd))
            {
                JsHelper.Alert(this, "您的密码不能为空");
                return;
            }
            if (string.IsNullOrWhiteSpace(pwdR))
            {
                JsHelper.Alert(this, "您的密码确认不能为空");
                return;
            }
            if (pwd != pwdR)
            {
                JsHelper.Alert(this, "两次密码不一致");
                return;
            }
            // --1、账号重复 2、手机号重复   3、添加成功
            UserBLL userBLL = new UserBLL();
            string result = userBLL.RegUser(account, tel, pwd);
            JsHelper.Alert(this, result);
        }


    }
}